package com.ruoyi.web.controller.net;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.net.domain.BusiMtnChannelRouteGraph;
import com.ruoyi.net.service.IBusiMtnChannelRouteGraphService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 业务-MTN Channel路由图link（顺序）Controller
 * 
 * @author tony
 * @date 2024-12-08
 */
@Api(tags = "业务-MTN Channel路由图link（顺序）")
@RestController
@RequestMapping("/busi/mtn/channel/route/graph")
public class BusiMtnChannelRouteGraphController extends BaseController
{
    @Autowired
    private IBusiMtnChannelRouteGraphService busiMtnChannelRouteGraphService;

    /**
     * 查询业务-MTN Channel路由图link（顺序）列表
     */
    @ApiOperation(value = "查询业务-MTN Channel路由图link（顺序）列表", httpMethod = "GET")
    @PreAuthorize("@ss.hasPermi('net:graph:list')")
    @GetMapping("/list")
    public TableDataInfo list(BusiMtnChannelRouteGraph busiMtnChannelRouteGraph)
    {
        startPage();
        List<BusiMtnChannelRouteGraph> list = busiMtnChannelRouteGraphService.selectBusiMtnChannelRouteGraphList(busiMtnChannelRouteGraph);
        return getDataTable(list);
    }

    /**
     * 导出业务-MTN Channel路由图link（顺序）列表
     */
    @ApiOperation(value = "导出业务-MTN Channel路由图link（顺序）列表", httpMethod = "POST")
    @PreAuthorize("@ss.hasPermi('net:graph:export')")
    @Log(title = "业务-MTN Channel路由图link（顺序）", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BusiMtnChannelRouteGraph busiMtnChannelRouteGraph)
    {
        List<BusiMtnChannelRouteGraph> list = busiMtnChannelRouteGraphService.selectBusiMtnChannelRouteGraphList(busiMtnChannelRouteGraph);
        ExcelUtil<BusiMtnChannelRouteGraph> util = new ExcelUtil<BusiMtnChannelRouteGraph>(BusiMtnChannelRouteGraph.class);
        util.exportExcel(response, list, "业务-MTN Channel路由图link（顺序）数据");
    }

    /**
     * 获取业务-MTN Channel路由图link（顺序）详细信息
     */
    @ApiOperation(value = "获取业务-MTN Channel路由图link（顺序）详细信息", httpMethod = "GET")
    @PreAuthorize("@ss.hasPermi('net:graph:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(busiMtnChannelRouteGraphService.selectBusiMtnChannelRouteGraphById(id));
    }

    /**
     * 新增业务-MTN Channel路由图link（顺序）
     */
    @ApiOperation(value = "新增业务-MTN Channel路由图link（顺序）", httpMethod = "POST")
    @PreAuthorize("@ss.hasPermi('net:graph:add')")
    @Log(title = "业务-MTN Channel路由图link（顺序）", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BusiMtnChannelRouteGraph busiMtnChannelRouteGraph)
    {
        return toAjax(busiMtnChannelRouteGraphService.insertBusiMtnChannelRouteGraph(busiMtnChannelRouteGraph));
    }

    /**
     * 修改业务-MTN Channel路由图link（顺序）
     */
    @ApiOperation(value = "修改业务-MTN Channel路由图link（顺序）", httpMethod = "PUT")
    @PreAuthorize("@ss.hasPermi('net:graph:edit')")
    @Log(title = "业务-MTN Channel路由图link（顺序）", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BusiMtnChannelRouteGraph busiMtnChannelRouteGraph)
    {
        return toAjax(busiMtnChannelRouteGraphService.updateBusiMtnChannelRouteGraph(busiMtnChannelRouteGraph));
    }

    /**
     * 删除业务-MTN Channel路由图link（顺序）
     */
    @ApiOperation(value = "删除业务-MTN Channel路由图link（顺序）", httpMethod = "DELETE")
    @PreAuthorize("@ss.hasPermi('net:graph:remove')")
    @Log(title = "业务-MTN Channel路由图link（顺序）", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(busiMtnChannelRouteGraphService.deleteBusiMtnChannelRouteGraphByIds(ids));
    }
}
